package com.sh.caryr.erp.entity.product;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.sh.caryr.erp.entity.enums.ProductTypeEnum;
import com.sh.caryr.erp.util.ERPConstants;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 套件详情表
 * </p>
 *
 * @author milkeeper
 * @since 2017-11-28
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("erp_comb_detail")
public class CombDetail implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 套件详情ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    /**
     * 商品ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long productId;
    /**
     * 类型，含sku套件：1，不含sku套件：2
     */
    private ProductTypeEnum type;
    /**
     * 套件详情名称
     */
    private String combDetailName;
    /**
     * 套件详请编号
     */
    private String combDetailCode;
    /**
     * 套件销售价
     */
    private Float combPrice;
    /**
     * 图片
     */
    private String img;

    /**
     * 总数量
     */
    @TableField(exist = false)
    private Float totalAmount;

    /**
     * 次品数量
     */
    @TableField(exist = false)
    private Float notGoodAmount;

    /**
     * 锁定数量
     */
    @TableField(exist = false)
    private Float lockedAmount;

    @TableField(exist = false)
    private List<CombNum> combNumList;
    /**
     * 数据是否可用
     */
    private int isActive = ERPConstants.ENITYT_ACTIVE;
}
